#include <iostream>
#include <unistd.h>
#include <memory>
#include "Thread.hpp"

void *thread_run(void *args)
{
    string work_type = static_cast<const char *>(args);
    while (1)
    {
        cout << "我是一个新线程,我正在做：" << work_type << endl;
        sleep(1);
    }
}
int main()
{
    unique_ptr<Thread> thread1(new Thread(thread_run, (void *)"printThread", 1));
    unique_ptr<Thread> thread2(new Thread(thread_run, (void *)"CountThread", 2));
    unique_ptr<Thread> thread3(new Thread(thread_run, (void *)"DeleteThread", 3));

    thread1->join();
    thread2->join();
    thread3->join();

    while (1)
    {
        cout << "我是主线程" << endl;
    }
    return 0;
}